You are here: Building the Model: General Elements > Pre-defined Tank Subroutines > Tank_Empty
Syntax samples
TANK_EMPTY (<Tank ID>, <Empty Quantity>, <Empty Rate>, <Resume Level>)
TANK_EMPTY (TankB, 2000, 40, 0)
Description
Empties a tank by a specified quantity and rate. The state is set to Tank_Emptying, then to Tank_Idle if the tank becomes empty.
Use Tank_Empty when the destination is not another tank, but an arriving entity or a source that is not part of the model.
Components
<Tank ID>
The tank name or location index number.
<Empty Quantity>
The number of units (gallons, pounds) to empty. To empty a tank completely of its current contents, enter Tank_Level [<Tank ID>].
<Empty Rate>
The rate in units (gallons, pounds) per time unit defined in the General Information dialog. To instantly decrease the level of a tank, use the Tank_Dec subroutine. To specify a dynamically calculated rate using the Tank_Rate subroutine, enter 0.
<Resume level>
If the tank level drops to 0 before you empty the specified quantity, the tank must rise to the resume level before continuing to empty. To terminate emptying if the level ever drops to 0, enter Tank_Stop. A value of 0 causes an error to occur if the tank becomes empty before removing the specified quantity.
Example
When a chemical tank, ChemTank, is full (state is Tank_Blocked), workers pump its contents into a rail car at a rate of 60 gpm for transportation to another facility. Since rail cars are always available and the delivery activity is not of interest, it is not necessary to model the rail cars explicitly. Instead, activate a subroutine in the initialization logic with the following statement:
Tank_Loop //logic repeats continuously
{
WAIT UNTIL Tank_State[ChemTank]=Tank_Blocked
Tank_Fill(ChemTank, Tank_Level[ChemTank], 60, 0)
}
See Also